$(function(){
	var mPhone=GetQueryString("mPhone");
	$("#mPhone").val(mPhone);
	$("#mPhone").attr({ readonly: 'true' });
	$("#confirm").click(function(){
		var mPwd=$("#mPwd").val();
		var confirmPwd=$("#confirmPwd").val();
		if(mPwd!=confirmPwd){
			var message = "两次密码输入不一致，请重新输入！！！";
			addStyle(message);
			return false;
		}
		var data = $("form").serialize();
		$.ajax({
			type:"post",
			url:rootPath+"/member/register2",
			data:data,
			//dataType:"json",
			success:function(data){
				if(data.resultSuccess){
					window.location.href=rootPath+"/member/loginPre"
				}else{
					$("#msg").text(data.resultDesc);
				}
			}
		})
	})
})
//获取请求中的参数
function GetQueryString(name) {  
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");  
    var r = window.location.search.substr(1).match(reg);  //获取url中"?"符后的字符串并正则匹配
    var context = "";  
    if (r != null)  
         context = r[2];  
    reg = null;  
    r = null;  
    return context == null || context == "" || context == "undefined" ? "" : context;  
}

function addStyle(message){
	$("#confirmPwd").css('height','70px');
	$("#msg").text(message)
	$("#msg").css('display','block');
}
